package com.ruoyi.internship.mapper;

import com.ruoyi.internship.domain.BolePostionApplication;
import com.ruoyi.internship.dto.PositionApplicationDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PositionApplicationMapper {
    @Select("SELECT " +
            "bpa.application_id AS applicationId, " +
            "bpa.user_id AS userId, " +
            "bpa.position_id AS positionId, " +
            "bpa.apply_time AS applyTime, " +
            "bpa.status AS status, " +
            "br.id AS resumeId, " +
            "br.name AS name, " +
            "br.gender AS gender, " +
            "bre.major AS major, " +
            "bp.title AS title, " +
            "bp.type AS type " +
            "FROM bole_postion_application AS bpa " +
            "LEFT JOIN bole_resumes AS br ON bpa.user_id = br.user_id " +
            "LEFT JOIN bole_resume_education AS bre ON br.id = bre.resume_id " +
            "LEFT JOIN bole_position AS bp ON bpa.position_id = bp.position_id" +
            " order by application_id desc")
    List<PositionApplicationDTO> selectApplicationWithDetails(BolePostionApplication application);
}
